package commands.gui;

import dataTypes.File;
import java.util.List;
import java.util.ListIterator;

/**
 * Command returning names of shared files
 * @author Marcin Kamionowski
 */
public class GUISharedFilesList extends GUICommand {

    private final List<File> sharedFilesList;

    /**
     * Constructor
     * @param sharedFilesList List of shared files
     */
    public GUISharedFilesList(List sharedFilesList) {
        super(GUICommandType.SHARED_FILES_LIST);
        this.sharedFilesList = sharedFilesList;
    }

    /**
     * Getter
     * @return List of shared files
     */
    public List<File> getSharedFilesList() {
        return sharedFilesList;
    }

    /**
     * Getter
     * @return Iterator of list containing shared files descriptors
     */
    public ListIterator<File> getIterator(){
        return sharedFilesList.listIterator();
    }
}
